<?php include "htmlBase/header.php"; ?>

<?php
include_once 'Entidades/EntidadeBase.php';
include_once 'Entidades/Observacao.php';
$servicoObservacao = new Observacao();

$id_Responsavel = $_GET["id_Responsavel"];
$Observacao = $servicoObservacao->ObterPrimeiro("id_Responsavel = $id_Responsavel");

if ($Observacao == NULL)
{
    $Observacao = new Observacao();
    $Observacao->id_Responsavel = $id_Responsavel;
}
?>

<div class="page">
    <div class="page-header">
        <div class="page-header-content">
            <h1><span style="padding-left:80px">Observações</span> <small>(Cadastro)</small></h1>
            <a href="ResponsavelPainel.php?Id=<?php echo $Observacao->id_Responsavel; ?> "class="back-button big page-back"></a>
        </div>
        <div class="progress-bar" align="rigth">
            <div class="bar bg-color-blue" style="width: 75%"></div>
        </div>
    </div>
    <br/>
    <div class="page">
        <div class="page-region">
            <div class="page-region-content">

                <form action="ObservacaoDados.php" method="POST">

                    <div class="input-control" style="width: 60%; margin-left: auto; margin-right: auto;">
                        <input type="hidden" class="with-helper" name="Id" value="<?php echo $Observacao->Id; ?>"/>
                        <input type="hidden" class="with-helper" placeholder="id_Responsavel" name="id_Responsavel" value="<?php echo $Observacao->id_Responsavel; ?>"/>
                        <h4>Observações</h4>
                        <textarea name="Observacao" rows="15" cols="100%" style="width: 100%" maxlength="4000"><?php echo $Observacao->Observacao; ?></textarea> 
                    </div>

                    <br/>

                    <div class="input-control" style="margin-left: auto; margin-right: auto;">
                        <button class="standart default" type="submit">Salvar</button>
                        <?php
                        if ($Observacao->Id != 0)
                        {
                            ?>
                            <a href="ObservacaoCadastro.php?id_Responsavel=<?php echo $Observacao->id_Responsavel; ?>" class="button standart">Cancelar</a>
                            <?php
                        }
                        ?>


                        <a href="ResponsavelPainel.php?Id=<?php echo $Observacao->id_Responsavel; ?>" class="button standart bg-color-lighten" style="float: right">Voltar</a>
                    </div>

                </form>
            </div>
        </div>
    </div>

</div>

<?php include "htmlBase/footer.php"; ?>
